home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / rsxwdk2s.zip / RSXWDK / LIBSRC / DOS / DOS39.C < prev    next >
C/C++ Source or Header  |  1994-12-17  |  409b  |  25 lines

  1. #include <errno.h>
  2. #include <sys/doscalls.h>
  3.  
  4. /*
  5. ** AH = 0x39
  6. ** DS:DX name (64 bytes)
  7. */
  8. int dos_mkdir(const char *name)
  9. {
  10.     struct REGPACK r;
  11.     struct SEGPACK sr = { GetDS(), GetES()};
  12.  
  13.     r.eax = 0x3900;
  14.     SET_SEG_OFF(name, sr.ds, r.edx);
  15.  
  16.     _intxr(0x21, &r, &sr);
  17.  
  18.     if (r.eflags & 1) {
  19.     _sys_doserror2errno( r.eax & 0xFFFF);
  20.     return (-1);
  21.     }
  22.     else
  23.     return (0);
  24. }
  25.